import  os
def r(p):
    f=open(p)
    s=f.read()
    f.close()
    return s


s=r(r'D:\Download\runoob\www.runoob.com\about\a.txt')

hz=['jpg','png','gif','bmp','tif','ico']
for root,dirs,files in os.walk(r'D:\Download\runoob\www.runoob.com'):
    for f in files:
        flag=0
        for i in hz:
            if f.endswith('.'+i):
                flag=1
                break
        if flag:continue
        a=os.path.join(root,f)
        if r(a).find(s)>0:
            os.remove(a)
            print a


